<div class="left">
    <div class="miniblog">
        <h1 class="titles">欢迎，<?php echo $current_user['User']['username'] ?>！</h1>
        <h2 class="sub-titles">最新的提问和回答</h2>
        <ul>
            <?php foreach ($questions as $question): ?>
            <li>
                <p class="avatar"><?php echo $avatar->userLink($question['User']) ?><?php echo $linker->userLink($question['User']) ?></p>
                <p class="info"><?php echo $html->link($question['Question']['title'], "/questions/view/{$question['Question']['id']}") ?>

                        <?php echo $question['Question']['created'] ?><br>
                        <?php echo $question['Question']['body'] ?></p>

                <p class="clear"></p>
            </li>
            <?php endforeach ?>
        </ul>
        <h2 class='sub-titles'>最新的同城活动</h2>
        <table  class="post-list">
            <tr>
                <th>活动名称</th>
                <th>创建时间</th>
                <th>归属小组</th>
                <th>开始时间</th>
                <th>结束时间</th>
            </tr>
            <?php
            foreach ($events as $event):
                ?>
            <tr>
                <td><?php echo $this->Html->link(__($event['Event']['name'], true), array('action' => 'view', $event['Event']['id'])); ?>&nbsp;</td>
                <td><?php echo $event['Event']['created']; ?>&nbsp;</td>
                <td><?php echo $event['Group']['name']; ?>&nbsp;</td>
                <td><?php echo $event['Event']['begins']; ?>&nbsp;</td>
                <td><?php echo $event['Event']['ends']; ?>&nbsp;</td>

            </tr>
            <?php endforeach; ?>
        </table>

        <h2 class="sub-titles"><?php __('最新职位');?></h2>
        <table class="post-list">
            <tr><td>语言</td><td>职位名称</td><td>发布者</td><td>发布时间</td><td>截止日期</td></tr>
            <?php foreach ($jobs as $job):?>
            <tr>
                <td><?php echo $this->Html->link($job['Language']['name'],array('controller'=>'languages','action'=>'view',$job['Language']['id'])) ?></td>
                <td><?php echo $this->Html->link($job['City']['name']."-".$job['Job']['name'], array('controller' => 'jobs', 'action' => 'view', $job['Job']['id'])); ?></td>
                <td>
                        <?php echo $this->Linker->userLink($job['User']); ?>
                </td>
                <td><?php echo $job['Job']['updated']; ?>&nbsp;</td>
                <td><?php echo $time->format($format="Y-m-d",$job['Job']['ends']); ?>&nbsp;</td>
            </tr>
            <?php endforeach; ?>
        </table>

        <h2 class='sub-titles'>最新的单词</h2>
        <table class="post-list">
            <tr>
                <th>单词</th>
                <th>添加者</th>
                <th>添加时间</th>
                <th>最后编辑</th>
                <th>语言</th>
                <th >编辑</th>
            </tr>
            <?php
            $i = 0;
            foreach ($words as $word):
                $class = null;
                if ($i++ % 2 == 0) {
                    $class = ' class="altrow"';
                }
                ?>
            <tr<?php echo $class; ?>>
                <td><?php echo $word['Word']['word']; ?>&nbsp;</td>
                <td>
                        <?php echo $this->Html->link($word['User']['username'], array('controller' => 'users', 'action' => 'view', $word['User']['id'])); ?>
                </td>
                <td><?php echo $word['Word']['created']; ?>&nbsp;</td>
                <td><?php echo $word['Word']['updated']; ?>&nbsp;</td>
                <td><?php echo $html->link($word['Language']['name'], "/languages/view/{$word['Language']['id']}"); ?>&nbsp;</td>
                <td class="actions">
                        <?php echo $this->Html->link(__('编辑', true), array('action' => 'edit', $word['Word']['id'])); ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </table>
    </div>
</div>
<div class="right">
    <?php echo $html->link('我要提问', '/questions/add',array('class'=>'btn')) ?>

</div>


